package webEquipeRechercheGwt.client.handler.navigation;

import webEquipeRechercheGwt.client.abstractPanels.TeamPanelAbstract;
import webEquipeRechercheGwt.client.entityMirror.TeamMirror;
import webEquipeRechercheGwt.client.factory.WidgetFactory;
import webEquipeRechercheGwt.client.structure.DataShowingPanel;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;

public class ClickHandlerTeam implements ClickHandler {
	TeamMirror target;
	DataShowingPanel mainPanel;

	public ClickHandlerTeam(TeamMirror team, DataShowingPanel mainPanel){
		super();
		this.mainPanel = mainPanel;
		target = team;
	}
	
	@Override
	public void onClick(ClickEvent event) {
		TeamPanelAbstract panel = WidgetFactory.getTeamPanel(target, mainPanel);
		mainPanel.setCurrentPanel(panel);
	}

}
